import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef } from '@angular/material';
import { MAT_DIALOG_DATA } from '@angular/material';

@Component({
    selector: 'app-confirm-dialog',
    templateUrl: './confirm.dialog.component.html',
    styleUrls: ['./confirm.dialog.component.css'],
})
export class ConfirmDialogComponent implements OnInit {

    config = {
        title: '',
        content: '',
        button: '',
    };

    constructor(public dialogRef: MatDialogRef<ConfirmDialogComponent>, @Inject(MAT_DIALOG_DATA) data: any) {
        this.config.title = data.title || '确认操作';
        this.config.content = data.content || '';
        this.config.button = data.button || '确认';
    }

    public ngOnInit() { }
}
